package com.htpay.model.eo;

/**
 * 支付宝收款账户
 */
public enum AlipayReceiveAccount {
    AP_ACCOUNT_01(1, "2088232394869181", "15256599602", "王翠贤");

    private Integer id;
    private String partnerId;
    private String partnerAccount;
    private String partnerName;

    public Integer getId() {
        return id;
    }

    public String getPartnerId() {
        return partnerId;
    }

    public String getPartnerAccount() {
        return partnerAccount;
    }

    public String getPartnerName() {
        return partnerName;
    }

    /**
     * 构造函数
     *
     * @param id
     * @param partnerId
     * @param partnerAccount
     * @param partnerName
     */
    AlipayReceiveAccount(Integer id, String partnerId, String partnerAccount, String partnerName) {
        this.id = id;
        this.partnerId = partnerId;
        this.partnerAccount = partnerAccount;
        this.partnerName = partnerName;
    }

    /**
     * 动态生成调用支付宝账号：默认的产生1条记录
     *
     * @return
     */
    public static AlipayReceiveAccount generateAccount() {
        int id = 1;

        for (AlipayReceiveAccount aa : AlipayReceiveAccount.values()) {
            if (aa.id == id) return aa;
        }

        return AP_ACCOUNT_01;
    }
}
